# Contributor: Matt Dainty <matt+alpine@bodgit-n-scarper.com>
# Contributor: TBK <alpine@jjtc.eu>
# Contributor: Dermot Bradley <dermot_bradley@yahoo.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=py3-jsonpointer
_pkgname=python-json-pointer
pkgver=2.4
pkgrel=2
pkgdesc="Identify specific nodes in a JSON document (RFC 6901)"
url="https://github.com/stefankoegl/python-json-pointer"
arch="noarch"
license="BSD-3-Clause"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/stefankoegl/python-json-pointer/archive/v$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver

replaces="py-jsonpointer" # Backwards compatibility
provides="py-jsonpointer=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m unittest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
0d4ee2fa8bd24c4aeabce9c30df539dfb1089879c7c697bfb7bf997227e640d37dd485ef1eb9e3c4bdfdffc8b597f01b0b45180c16c29727d4afed30f573995b  py3-jsonpointer-2.4.tar.gz
"
